- Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy path851. Loud and Rich_test.go
43 lines (34 loc) · 751 Bytes
/
851. Loud and Rich_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package leetcode
import (
"fmt"
"testing"
)
typequestion851struct {
para851
ans851
}
// para 是参数
// one 代表第一个参数
typepara851struct {
richer [][]int
quiet []int
}
// ans 是答案
// one 代表第一个答案
typeans851struct {
one []int
}
funcTest_Problem851(t*testing.T) {
qs:= []question851{
{
para851{[][]int{{1, 0}, {2, 1}, {3, 1}, {3, 7}, {4, 3}, {5, 3}}, []int{3, 2, 5, 4, 6, 1, 7, 0}},
ans851{[]int{5, 5, 2, 5, 4, 5, 6, 7}},
},
}
fmt.Printf("------------------------Leetcode Problem 851------------------------\n")
for_, q:=rangeqs {
_, p:=q.ans851, q.para851
fmt.Printf("【input】:%v 【output】:%v\n", p, loudAndRich(p.richer, p.quiet))
}
fmt.Printf("\n\n\n")
}